package string

import (
	"fmt"
	"strings"
)

func init()  {
	str1 := "34ffffevev"
	fmt.Println(len(str1))
	str2:= str1+"erfererer"
	fmt.Println(str2)
	str3:=strings.Split(str2,"e")
	fmt.Println(str3)
	fmt.Println(strings.Contains(str2,"e"))
	fmt.Println(strings.HasPrefix(str2,"34ff"))
	fmt.Println(strings.HasSuffix(str2,"erer"))
	fmt.Println(strings.Index(str2,"e"))
	fmt.Println(strings.LastIndex(str2,"e"))
	fmt.Println(strings.Join(str3,"e"))

	s:="pprof.cn博客の"
	for _,r:=range s{
		//rune类型
		fmt.Printf("%v(%c)\n", r, r)
	}

	//修改字符串
	s100:="hello"
	byteS1 :=[]byte(s100)
	byteS1[0]='H'
	s200:=string(byteS1)
	fmt.Println(s200)
	s101:="博客"
	runeS1:=[]rune(s101)
	runeS1[0]='狗'
	fmt.Println(string(runeS1))

	fmt.Println("--------------")
}
